﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace IDE_week2_Forms_project
{
    using System.Globalization;
    using System.Threading;
    
    public partial class Form1 : Form
    {
        int state = 0;
        public Form1()
        {
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("pt-BR");
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void btReset_Click(object sender, EventArgs e)
        {
            this.Icon = null;
        }

        private void btOpenNewForm_Click(object sender, EventArgs e)
        {
            Form2 frm = new Form2();
            frm.Show();
        }

        private void btChangeIcon_Click(object sender, EventArgs e)
        {
            this.Icon = IDE_week2_Forms_project.Properties.Resources.Icon1;
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void btChangeLanguage_Click(object sender, EventArgs e)
        {
            if (this.state == 0)
            {
                ChangeLanguage("en");
                this.state = 1;
            }
            else
            {
                ChangeLanguage("pt-BR");
                this.state = 0;
            }

        }
 
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void btCallClass_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }
    }
}


 